<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .father {
            width: 300px;
            height: 300px;
            background-color: pink;
        }
        .son {
            width: 100px;
            height: 100px;
            background-color: yellow;
        }
    </style>
</head>
<body>
    <div class="father">
        <div class="son">

        </div>
    </div>
    <script>
        /* 阻断事件捕获 */
        const father = document.querySelector('.father')
        const son  = document.querySelector('.son')
        document.addEventListener('click', function(e){
            console.log('document clicked');
            e.stopPropagation()
        }, true)
        father.addEventListener('click', function(){
            console.log('father clicked');
        })
        son.addEventListener('click', function(){
            console.log('son clicked');
        }, true)

    </script>
</body>
</html>